home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Clinical Endocrinology
/
Clinical Endocrinology.iso
/
mac
/
00000000
/
01000000
/
01070000
/
Shared.dir
/
00956_Script_956
< prev
next >
Wrap
Text File
|
1995-11-17
|
2KB
|
74 lines
-- Sprite 17 is the menu text sprite. Sprite 19 is a QD rect which
-- is red and has "add" ink. Its initial location is above the stage.
-- This handler senses how big the menu is ( how many lines etc.),
-- and sizes the QD rect to fit one line at a time if the menu is
-- rolled over.
on menuDrop
global greyLine, menuSwitch
if voidP(menuSwitch) then set menuSwitch = "off"
if menuSwitch = "off" then
scaleMenuBox
end if
getGreyLine
put the number of lines in field "Menu Listing" into theLines
put the top of sprite 17 into theTop
put the bottom of sprite 17 - theTop into theDepth
put theDepth / theLines into theIncrement
put the width of sprite 17 into theWidth
put the left of sprite 17 into theLeft
set the height of sprite 19 to theIncrement
set the width of sprite 19 to theWidth
set the mouseDownScript to EMPTY
repeat while rollOver(17)
set the foreColor of sprite 19 to 35
put ( the mouseV - theTop ) / theIncrement into pointerLine
if the mouseDown then
if pointerLine >= 0 and pointerLine < theLines then checkMenuChoice pointerLine
end if
set the locV of sprite 19 = theTop + (pointerLine * theIncrement)
set the locH of sprite 19 = theLeft
updateStage
end repeat
end menuDrop
--------------------------------------------------------------------
-- This handler is called from the one above to sense which line
-- is greyed out. The result is stored as a global.
on getGreyLine
global greyLine
put the number of lines in field "Menu Listing" into theLines
repeat with i = 1 to theLines
if the foreColor of line i of field "Menu Listing" <> 255 then
put i into greyline
end if
end repeat
end getGreyLine
--------------------------------------------------------------------
-- This handler is called from menuDrop (above), when the mouse is clicked.
-- It ignores a click on a grey line and calls the correct handler relating
-- to jumping to the correct movie ( menuItem whichLine ).
on checkMenuChoice whichLine
global greyLine, jumpFrame, menuSwitch
put whichLine + 1 into whichLine -- incremented by 1 to relate to a text line
if whichLine = greyLine then
set the mouseDownScript to "dontPassEvent"
else
set menuSwitch = "off"
set the mouseDownScript to EMPTY
menuItem whichLine
sound playFile 1, "Click.aif"
abort
end if
end checkMenuChoice